from Base import Base
from selenium.webdriver.common.by import By
import time
class Page(Base):
    #输入用户名
    username_loc={By.ID,'use'}
    #输入密码
    password_loc={By.ID,'pwd'}
    #点击登录
    button_loc={By.ID,'log'}
    #搜索框输入小张
    search_loc={By.XPATH,'/html/body/div[1]/div[1]/div[2]/div/input'}
    #点击搜索
    sou_loc={By.XPATH,'/html/body/div[1]/div[1]/button[2]'}


    def login(self):
        self.open_url("http://localhost:8080/")
        time.sleep(5)
        self.send_keys(self.username_loc,'张三')
        time.sleep(5)
        self.send_keys(self.password_loc,'12345678')
        time.sleep(5)
        self.click(self.button_loc)
        time.sleep(5)
        self.send_keys(self.search_loc,'小张')
        time.sleep(5)
        self.click(self.sou_loc)
        time.sleep(5)

